package com.luckku.boot.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luckku.boot.mapper.OrderMapper;
import com.luckku.boot.model.entity.Goods;
import com.luckku.boot.model.entity.OrderInfo;
import com.luckku.boot.model.vo.CartVo;
import com.luckku.boot.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author luckku
 * @date 2021/12/18
 */

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implements IOrderService {

    @Autowired
    OrderMapper orderMapper;

    @Override
    public List<CartVo> getOrderGoodsList(String orderId, String storeId) {
        return orderMapper.getOrderGoodsList(orderId, storeId);
    }

    @Override
    public Long getCashFlow(Long days) {
        return orderMapper.getCashFlow(days);
    }

    @Override
    public Long getStoreCashFlow(Long days, String storeId) {
        return orderMapper.getStoreCashFlow(days, storeId);
    }

    @Override
    public Page<OrderInfo> getList(Page<OrderInfo> page) {
        return this.baseMapper.selectPage(page,new QueryWrapper<>());
    }

    @Override
    public Goods getBestSelling() {
        return this.baseMapper.getBestSelling();
    }

    @Override
    public Long getBestSellingCount() {
        return this.baseMapper.getBestSellingCount();
    }
}
